Excel page break not reflected in generated pdf

您所在的位置:网站首页 excel page break not working Excel page break not reflected in generated pdf

Excel page break not reflected in generated pdf

2023-03-11 03:39| 来源: 网络整理| 查看: 265

@joneilbc,

We evaluated your issue further. As you can see in Microsoft Excel(see attachment “Microsoft_Excel_calculated_scale.png”), 1 page width and two pages height is set, Microsoft Excel calculates the page scale is 60%. But when you take printview it in Excel, you can find that there is much white space at the end of the second page(see attachment “Microsoft_Excel_white_space.png”, print gridlines is enabled).

However, we calculate the page scale is 66%, you can check it with the following code:

Workbook wb = new Workbook(srcFile); SheetRender sr = new SheetRender(wb.Worksheets[0], new ImageOrPrintOptions()); Console.WriteLine(sr.PageScale);

Now, let’s check whether page scale is good for the page setup(1 page width and 2 pages height). Firstly, reset all page breaks(see attachment “reset_page_breaks.png”), because there is a horizontal page break, if it is not being cleared, it will take effect while page scale is set. Secondly, set page scale to 66%(see attachment “set_page_scale.png”). Thirdly, take printview it in Excel, you will see the sheet is fit to two pages well. There is not too much white space at the end of second page. The page break is same as the one in our generated PDF.

Fourthly, you can also try to set page scale to 67%(same as the second step), you will find the sheet is printed to three page.

So, we think the 66% is good for the page setup(1 page width and 2 pages height), but 60% is too small. Microsoft_Excel_calculated_scale.png (134.3 KB) Microsoft_Excel_white_space.png (119.8 KB) reset_page_breaks.png (89.9 KB) set_page_scale.png (133.9 KB)



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3